package cn.itsource.ymcc.client;

import cn.itsource.ymcc.client.fallback.CourseFeignClientFallbackFactory;
import cn.itsource.ymcc.domain.CourseUserLearn;
import cn.itsource.ymcc.result.JSONResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;


@RequestMapping("/course")
@FeignClient(value = "service-course",fallbackFactory = CourseFeignClientFallbackFactory.class)
public interface CourseFeignClient {

    @RequestMapping(value = "/info/json/{id}",method = RequestMethod.GET)
    JSONResult getCourseInfo(@PathVariable("id")Long id);

    @RequestMapping(value = "/infos/json",method = RequestMethod.POST)
    JSONResult getCourseInfos(@RequestBody List<Long> courseIds);
}
